package com.mixsmart.commonweb.service.impl;

import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mixsmart.commonweb.bean.IPKStringBean;
import com.mixsmart.commonweb.service.IWebMgrService;
import com.mixsmart.core.bean.entity.IEntityBean;
import com.mixsmart.core.service.impl.MgrService;
import com.mixsmart.spellsql.utils.Cnd;
import com.mixsmart.spellsql.utils.Exp;

/**
 * Web管理服务类
 * @author lmq
 * @version 1.0
 * @since JDK1.6以上
 * <br />
 * 2016年7月23日
 * @param <T>
 */
public abstract class WebMgrService<T extends IPKStringBean> extends MgrService<T, String> implements IWebMgrService<T> {

	@Override
	@Transactional(propagation=Propagation.SUPPORTS,readOnly=true)
	public List<T> finds(String[] ids) {
		return super.finds(Cnd.where(Exp.in("id", ids)));
	}

	@Override
	@Transactional(propagation=Propagation.SUPPORTS,readOnly=true)
	public <E> List<E> finds(Class<? extends IEntityBean> clazz, String[] ids) {
		return super.finds(clazz, Cnd.where(Exp.in("id", ids)));
	}
	
}
